<!DOCTYPE html>
<html>
<head>
    <title>模具档案信息</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div>
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"></i-input>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>
</div>
<script>
    $(function () {
        $("#jqGrid").Grid({
            url: '../moduleseries/list',
            colModel: [
                {label: 'id', name: 'id', index: 'ID', key: true, hidden: true},
                {label: '机型编码', name: 'modelCode', index: 'MODEL_CODE', width: 80},
                {label: '机型名称', name: 'modelName', index: 'MODEL_NAME', width: 80},
            ]
        });
    });
    let vm = new Vue({
        el: '#rrapp',
        data: {
            showList: true,
            title: null,
            moduleSeries: {
                updateTime: '',
                updateUser: '',
                delFlag: '',
                createTime: '',
                creater: '',
                modelName: '',
                modelCode: '',
                id: '',
            },
            q: {
                name: ''
            },
        },
        methods: {
            query: function () {
                vm.reload();
            },
            reload: function (event) {
                vm.showList = true;
                let page = $("#jqGrid").jqGrid('getGridParam', 'page');
                $("#jqGrid").jqGrid('setGridParam', {
                    postData: {'name': vm.q.name},
                    page: page
                }).trigger("reloadGrid");
            },
            reloadSearch: function () {
                vm.q = {
                    name: ''
                };
                vm.reload();
            },
            handleReset: function (name) {
                handleResetForm(this, name);
            }
        }
    });
    var getDates = function () {
        let result = getSelectedRowData("#jqGrid");
        var id = result.id;
        if (id == null) {
            return false;
        } else {
            return result;
        }
    }
</script>
</body>
</html>
